﻿using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
using System.Threading.Tasks;
using VisionCloud.Domain.Common;
using VisionCloud.Domain.DtoModel.Fms;
using VisionCloud.Domain.Filters;
using VisionCloud.Service.Fms;

namespace VisionCloud.Api.Controllers.Fms
{
    /// <summary>
    /// Fms项目相关
    /// </summary>
    [SystemModule("Fms上传相关")]
    [ApiAuthorize(PolicyEnum.RequireRolePermission)]
    [ApiVersion("1.0")]
    [Route("api/fms/[controller]/[Action]")]
    [ApiExplorerSettings(GroupName = "Fms上传相关")]
    public class UploadController : ApiBaseController
    {

        public UploadService UploadService { get; set; }
        /// <summary>
        /// 分页获取FMS项目列表（附带楼栋楼层）
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost, SwaggerOperation(Tags = new[] { "管理" })]
        [SwaggerResponse(0, "云端处理完返回true", typeof(ApiResult))]
        public async Task<ApiResult> UploadAlgorithmResultToFms(UploadAlgorithmResultToFmsDto request)
        {
            return await TryCatchAsync(UploadService.UploadAlgorithmResultToFms(request));
        }
    }
}
